<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/2/11
 * Time: 16:36
 */

namespace app\admin\controller;


use app\common\lib\common\Redis;
use app\common\lib\common\StringHandle;

class Live extends Base
{
//    后台处理 push数据到页面
    public function push()
    {
        $postData = $this->request->post();
        // todo 组装前端需要格式的数据
        $fd = Redis::sMembers(StringHandle::live());
        if (!empty($fd)) {
            foreach ($fd as $fdv){
                $_POST['swoole_Ws_obj']->push($fdv,$postData['content']);
            }
        }
        return 'ok';
    }
}